﻿<%@ Page Title="" Language="C#" MasterPageFile="~/App_MasterPages/layout.Master" EnableEventValidation="false" EnableViewState="true" AutoEventWireup="true" CodeBehind="RSShoppingPart.aspx.cs" Inherits="mojoPortal.Web.RS.SBM.RSShoppingPart" %>
<%@ Register Src="controls/shoppingpartlistcontrol.ascx" TagName="ShoppingPartListControl" TagPrefix="uc1" %>
<%@ Register Src="~/rs/controls/modalactionmessagecontrol.ascx" TagName="ModalActionMessageControl" TagPrefix="uc1" %>
<%@ Register Src="controls/modalproductcontrol.ascx" TagName="ModalProductControl" TagPrefix="uc1" %>

<asp:Content ID="Content1" ContentPlaceHolderID="leftContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="mainContent" runat="server">

<div align="center">
<table width="40%">
<tr>
<td>
    <uc1:ShoppingPartListControl ID="ucShoppingPartListControl" runat="server"/>
</td>
</tr>
</table>
</div>

<table width="100%">
<tr>
<td>
Category:<asp:DropDownList ID="ddlInventoryCategory" runat="server" AutoPostBack="true"></asp:DropDownList>
&nbsp;&nbsp;
<asp:Button ID="btnReturn" runat="server" Text="Return" OnClick="btnReturn_Click" />
</td>
</tr>
</table>

<div class="page">
<asp:GridView ID="gvInventoryList" runat="server" AutoGenerateColumns="False" 
    AllowPaging="True" CellPadding="4" DataKeyNames="ProductId" 
    OnPageIndexChanging="gvInventoryList_PageIndexChanging" OnSorting="gvInventoryList_Sorting"
    OnSelectedIndexChanged="gvInventoryList_SelectedIndexChanged" 
    OnSelectedIndexChanging="gvInventoryList_SelectedIndexChanging"
    ForeColor="#333333" GridLines="None" Width="100%" >
    <AlternatingRowStyle BackColor="White" />
    <Columns>
        <asp:CommandField ShowSelectButton="True" ButtonType="Image" SelectImageUrl="~/RS/Images/checkmark.gif"/>
        <asp:BoundField DataField="CategoryName" HeaderText="CategoryName" SortExpression="CategoryName" HeaderStyle-HorizontalAlign="Left"/>

        <asp:TemplateField HeaderText="ProductName" HeaderStyle-HorizontalAlign="Left">
        <ItemTemplate>
            <asp:LinkButton ID="lnkEditInventoryItem" CommandArgument='<%# Eval("productid") %>' OnCommand="gvInventoryItem_Edit" runat="server" CausesValidation="false">
            <asp:Image runat="server" ID="editImage" ImageUrl="~/RS/Images/edit.gif" AlternateText="Edit" />
            </asp:LinkButton>
            <asp:Label ID="lblProductName" runat="server" Text='<%# Eval("ProductName") %>'></asp:Label>
        </ItemTemplate>
        </asp:TemplateField>

<%--        <asp:HyperLinkField DataNavigateUrlFormatString="~/RS/SBM/RSManageProduct.aspx?productid={0}" 
            DataTextField="ProductName" HeaderText="Product Name" DataNavigateUrlFields="productid" SortExpression="ProductName" HeaderStyle-HorizontalAlign="Left"/>
--%>        
        <asp:BoundField DataField="ProductId" HeaderText="Product ID" SortExpression="ProductId" HeaderStyle-HorizontalAlign="Left"/>
        <asp:BoundField DataField="UnitsInStock" HeaderText="Units In Stock" SortExpression="UnitsInStock" HeaderStyle-HorizontalAlign="Left"/>
        <asp:BoundField DataField="UnitPrice" HeaderText="Unit Price" SortExpression="UnitPrice" HeaderStyle-HorizontalAlign="Left"/>
        <asp:BoundField DataField="ModelNo" HeaderText="Model Number" SortExpression="ModelNo" HeaderStyle-HorizontalAlign="Left"/>
        <asp:TemplateField ShowHeader="False" HeaderText="Quantity" HeaderStyle-HorizontalAlign="Left">
            <ItemTemplate>
                <asp:TextBox ID="txtQuantity" runat="server" Width="20px" MaxLength="2" Enabled="false" BackColor="Gainsboro" />
                <asp:Button ID="btnAddPart" runat="server" Text="Add Part"  Width="80px" Visible="false" OnClick="btnAddPart_OnClick"/>
            </ItemTemplate>
        </asp:TemplateField>
    </Columns>
    <EditRowStyle BackColor="#2461BF" />
    <FooterStyle BackColor="#89A8E0" Font-Bold="True" ForeColor="White" />
    <HeaderStyle BackColor="#89A8E0" Font-Bold="True" ForeColor="White" />
    <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
    <RowStyle BackColor="#EFF3FB" />
    <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
    <SortedAscendingCellStyle BackColor="#F5F7FB" />
    <SortedAscendingHeaderStyle BackColor="#6D95E1" />
    <SortedDescendingCellStyle BackColor="#E9EBEF" />
    <SortedDescendingHeaderStyle BackColor="#4870BE" />
    <EmptyDataTemplate><br />
    <center>
    <asp:Label ID="lblNoRecordFound" runat="server" Text="There Are No Inventory Item" ForeColor="Silver" Font-Bold="True"></asp:Label>
    </center>
    </EmptyDataTemplate>
</asp:GridView>

</div>
<uc1:ModalActionMessageControl ID="ucModalActionMessageControl" runat="server"/>
<uc1:ModalProductControl ID="ucModalProductControl" runat="server" />

</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="rightContent" runat="server">
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="pageEditContent" runat="server">
</asp:Content>
